﻿
@{
    ViewBag.Title = "“4+7”集采药品使用监测表（同品类管理）";
}
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-form layui-card-header layuiadmin-card-header-auto">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">集采批次</label>
                    <div class="layui-input-inline" style="width:250px">
                        @Html.RelGroupPurchaseSelect("GpCode", "")
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">药品</label>
                    <div class="layui-input-inline" style="width:200px">
                        <select name="drugCode" id="drugCode" lay-search>
                            <option value="">请选择药品</option>
                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <button class="layui-btn layuiadmin-btn-list" lay-submit lay-filter="LAY-report-search">
                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                    </button>
                </div>
            </div>
        </div>
        <div class="layui-card-body">
            <table id="LAY-report-list" lay-filter="LAY-report-list"></table>
        </div>
    </div>
</div>
<style>
    .layui-table-cell {
        font-size: 14px;
        padding: 0 5px;
        height: 50px;
        overflow: visible;
        text-overflow: inherit;
        white-space: normal;
        word-break: break-all;
    }
</style>
<script type="text/javascript">
    layui.config({
        base: '/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'table', 'admin'], function () {
        var table = layui.table
            , form = layui.form
            , $ = layui.$
            , admin = layui.admin
            , util = layui.util;
        initTableBtn(table);

        //监听集采批次下拉框
        form.on('select(GpCode)', function (data) {
            var type = data.value;
            $.ajax({
                type: 'post',
                url: '/GroupChoseDrugCompare/GetChoseDrugInfo',
                data: "gpcode="+type,
                success(res) {
                    var str = '<option value="">请选择药品</option>';
                    for (var i in res) {
                        str += "<option value='" + res[i].DrugCode + "'>" + res[i].DrugName + "</option>";
                    }
                    $('#drugCode').html(str)
                    form.render();
                }
            })
        });

        table.render({
            elem: '#LAY-report-list'
            , height: 'full-100'
            , url: '/Report/GetVarietyList'//模拟接口
            , method: 'post'
            , cols: [[
                { field: 'GpName', title: '集采批次', width: 150, fixed: 'left', align: 'center'}
                , { field: 'DrugName', title: '中选药品名称', width: 200, fixed: 'left', align: 'center'}
                , { field: 'Specs', title: '规格', width: 80, fixed: 'left', align: 'center'}
                , { field: 'TaskQty', title: '中选药品年度任务量', width: 130, align: 'center'}
                , { field: 'TaskRate', title: '中选药品任务完成进度', width: 100, align: 'center' }
                , { field: 'UseRatio', title: '中选药品使用占比', width: 100, align: 'center'}
                , { field: 'TaskRatioStr', title: '中选药品医保局规定使用占比', width: 100, align: 'center'}
                , { field: 'UnitPrice', title: '单价', width: 130, align: 'center'}
                , { field: 'ProducerName', title: '生产厂家', width: 180, align: 'center'}
               /* , { field: 'UseNum', title: '中选药品使用数量', width: 180 }*/
            ]]
            , page: true
            , limit: 10
            , limits: [10, 15, 20, 25, 30]
            , text: { none: '暂无数据' }
        });

        //监听搜索
        form.on('submit(LAY-report-search)', function (data) {
            var field = data.field;
            //执行重载
            table.reload('LAY-report-list', {
                where: field,
                page: {
                    curr: 1 //重新从第 1 页开始
                }
            });
        });
    });
</script>

